package com.ruoyi.web.controller.util;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class TokenUtil {

    public static String userIdTokenCheck(HttpServletRequest request){
        String userId=null;
        Cookie[] cookies = request.getCookies();
        for (Cookie cookie : cookies) {
            if(cookie.getName().equals("token")){
                System.out.println(cookie.getValue());
                userId = cookie.getValue();
            }
        }
        return userId;
    }
}
